# Contributor: Hoang Nguyen <folliekazetani@protonmail.com>
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=helmfile
pkgver=0.145.2
pkgrel=0
pkgdesc="Declarative spec for deploying helm charts"
url="https://helmfile.readthedocs.io/"
arch="all !armhf" # blocked by helm
license="MIT"
depends="helm"
makedepends="go"
checkdepends="bash"
subpackages="
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/helmfile/helmfile/archive/refs/tags/v$pkgver.tar.gz"

build() {
	go build -v -o $pkgname -ldflags "-X github.com/helmfile/helmfile/pkg/app/version.Version=v$pkgver"
}

check() {
	go test ./...
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname

	install -Dm644 autocomplete/helmfile_bash_autocomplete \
		"$pkgdir"/usr/share/bash-completion/completions/$pkgname
	install -Dm644 autocomplete/helmfile_zsh_autocomplete \
		"$pkgdir"/usr/share/zsh/site-functions/_$pkgname
}

sha512sums="
3d5b6cab7c292a3085946de0a1d01724bea4985bec1bf3dea2bee2c11c40ea5329e67c66f59a4617261994d141ba245a28d6c6c037f540ae12d3256a26712024  helmfile-0.145.2.tar.gz
"
